package com.cx.common.spring;

import java.util.Properties;

/**
 * @Author:cxy
 * @Date:2019/10/24 15:11
 */
public class PropertiesUtils {
	
	private static Properties properties=new Properties();
	
	static{
		try {
			//注意属性配置文件所在的路径
			properties.load(PropertiesUtils.class.getClassLoader().getResourceAsStream("./properties/db.properties"));
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	
	//读取属性配置文件中的某个属性对应的值
	public static String get(String property){
		return (String) properties.get(property);
	}

}

